package com.qyer.search.model.mutable;

/**
 * Created by tangzheng on 16/8/11.
 */
public class Place {

  private int continentId;
  private int countryId;
  private int cityId;

  public Place(int continentId, int countryId, int cityId) {
    this.continentId = continentId;
    this.countryId = countryId;
    this.cityId = cityId;
  }

  public int getContinentId() {
    return continentId;
  }

  public void setContinentId(int continentId) {
    this.continentId = continentId;
  }

  public int getCountryId() {
    return countryId;
  }

  public void setCountryId(int countryId) {
    this.countryId = countryId;
  }

  public int getCityId() {
    return cityId;
  }

  public void setCityId(int cityId) {
    this.cityId = cityId;
  }

  @Override public boolean equals(Object o) {
    if (this == o)
      return true;
    if (o == null || getClass() != o.getClass())
      return false;

    Place place = (Place) o;

    if (continentId != place.continentId)
      return false;
    if (countryId != place.countryId)
      return false;
    return cityId == place.cityId;

  }

  @Override public int hashCode() {
    int result = continentId;
    result = 31 * result + countryId;
    result = 31 * result + cityId;
    return result;
  }

  @Override public String toString() {
    return "Place{" +
      "continentId=" + continentId +
      ", countryId=" + countryId +
      ", cityId=" + cityId +
      '}';
  }
}
